#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back

using namespace std;

using pii = pair < int , int >;
using vec = vector < int >;
using veg = vector < pii >;
using ll = long long;
using db = double;

int read() {
    int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
    while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 1e6 + 10;
const int mod = 1e9 + 7;

int inv[N],n,k,g[N],ans,sg[N];
int upd(int x) { return x + (x >> 31 & mod); }

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
	n = in,k = in; inv[1] = 1;
	for(int i = 2;i <= n;i++) inv[i] = 1ll * (mod - mod / i) * inv[mod % i] % mod;
	g[0] = sg[0] = 1;
	for(int i = 1;i <= n;i++) {
		g[i] = upd(sg[i - 1] - (i - k - 1 >= 0 ? sg[i - k - 1] : 0));
		g[i] = 1ll * g[i] * inv[i] % mod;
		sg[i] = upd(sg[i - 1] + g[i] - mod);
	}
	for(int i = 1;i <= n;i++) ans = upd(ans + g[i - 1] - mod);
	int pro = 1;
	for(int i = 1;i < n;i++) pro = 1ll * pro * i % mod,ans = 1ll * ans * i % mod;
	pro = 1ll * pro * n % mod; printf("%d\n",upd(pro - ans)); return 0;
}
